package com.example.mushroom.service.impl;

import com.example.mushroom.entity.Environment;
import com.example.mushroom.mapper.EnvironmentMapper;
import com.example.mushroom.service.EnvironmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class EnvironmentServiceImpl implements EnvironmentService {

    @Autowired
    private EnvironmentMapper environmentMapper;

    @Override
    public int insertEnvironment(Environment environment) {
        return environmentMapper.insertEnvironment(environment);
    }

    @Override
    public Environment selectEnvironmentById(Integer id) {
        return environmentMapper.selectEnvironmentById(id);
    }

    @Override
    public List<Environment> selectAllEnvironments() {
        return environmentMapper.selectAllEnvironments();
    }

    @Override
    public int updateEnvironment(Environment environment) {
        return environmentMapper.updateEnvironment(environment);
    }

    @Override
    public int deleteEnvironmentById(Integer id) {
        return environmentMapper.deleteEnvironmentById(id);
    }

    @Override
    public List<Environment> selectEnvironmentsByPage(int offset, int limit) {
        return environmentMapper.selectEnvironmentsByPage(offset, limit);
    }
}